package com.winshare.saleAssistant.service.impl;

import com.winshare.saleAssistant.service.NamingStrategy;

import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;

public class DailyStrategy implements NamingStrategy {

    public DailyStrategy() {
    }

    @Override
    public String getFolderName() {
        return LocalDateTime.now().toLocalDate().format(DateTimeFormatter.ISO_DATE) + "/";
    }

    @Override
    public String getFileName(String name) {
        return LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli() + "_" + name;
    }

    @Override
    public String getFolderName(String folder) {
        return folder + "/" + this.getFolderName();
    }
}
